[feat] Clean up message and tool spec cards#4710
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAcross three files, the collapse/expand mechanism for tool item cards and chat message items is refactored from JS-driven inline ChangesCSS-class-driven collapse for tool cards and chat messages
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Updates the Playground’s message and tool editor cards to improve usability and layout consistency by making collapse toggles always visible and adjusting default collapsed/expanded states to reduce vertical clutter.
Changes:
- Tool cards now default to collapsed (header-only), with updated padding/min-height behavior to fix gap/collision issues.
- Message cards keep default expanded, but adopt the always-visible collapse toggle and a new “1lh” body-clipping approach when minimized.
- Prompt schema container spacing and tool editor wrapper min-height were adjusted to better match the new collapsed layouts.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
web/packages/agenta-ui/src/ChatMessage/components/ChatMessageList.tsx |
Switches message “minimize” behavior to CSS clipping and makes the collapse toggle always visible. |
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/ToolItemControl.tsx |
Defaults tool cards to collapsed and hides the editor body when minimized; makes toggle always visible. |
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/PromptSchemaControl.tsx |
Tightens vertical spacing and removes the editor wrapper’s fixed min-height for tools. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 91e47168-8568-47b0-911e-5b4237d7015e
📒 Files selected for processing (3)
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/PromptSchemaControl.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/ToolItemControl.tsxweb/packages/agenta-ui/src/ChatMessage/components/ChatMessageList.tsx
Railway Preview Environment
|
291bca0 to
a43491d
Compare
Tool spec cards rendered expanded and, when collapsed, still showed a 3-line JSON peek. Default them to collapsed and size the collapsed height to the header only (title + optional description), so no JSON shows until expanded. Collapsed height is dynamic since not every tool has a description.
a43491d to
a332291
Compare
- Remove stray containerRef prop on ToolHeader (TS error). - Collapsed chat messages: cancel editor min-h-[70px] and hide the attachments footer + tool header so a minimized message is one line. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Revert the CSS-class max-h-[1lh] clip back to getCollapseStyle inline height animation (the established --editor-h contract); keep the hover-reveal header actions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 63f642b5-0e2a-493d-a8a4-cfaa519c9d2b
📒 Files selected for processing (1)
web/packages/agenta-ui/src/ChatMessage/components/ChatMessageList.tsx
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 63f642b5-0e2a-493d-a8a4-cfaa519c9d2b
📒 Files selected for processing (1)
web/packages/agenta-ui/src/ChatMessage/components/ChatMessageList.tsx
🛑 Comments failed to post (1)
web/packages/agenta-ui/src/ChatMessage/components/ChatMessageList.tsx (1)
192-195:
⚠️ Potential issue | 🟠 Major | ⚡ Quick winCollapsed message rows still render tool header/attachments.
When
isMinimizedis true,headerBottomandfooterare still rendered. That breaks the intended true single-line collapsed state and can reintroduce spacing/collision issues in dense lists.Suggested fix
- headerBottom={ - isToolResponse && (msg.name || msg.tool_call_id) ? ( + headerBottom={ + !isMinimized && isToolResponse && (msg.name || msg.tool_call_id) ? ( <ToolMessageHeader name={msg.name} toolCallId={msg.tool_call_id} /> ) : undefined } @@ - footer={ - hasAttachmentsFlag ? ( + footer={ + !isMinimized && hasAttachmentsFlag ? ( <MessageAttachments content={msg.content!} onRemove={(attachmentIndex) => onRemoveAttachment(index, attachmentIndex) } disabled={disabled} ImagePreview={ImagePreview} /> ) : undefined }Also applies to: 250-260
| <div | ||
| className={cn( | ||
| flexLayouts.rowCenter, | ||
| gapClasses.xs, | ||
| "invisible group-hover/item:visible", | ||
| )} | ||
| > |
| <div className="flex items-center gap-1 shrink-0"> | ||
| <div className="flex items-center gap-1 invisible group-hover/tool:visible"> | ||
| {!isReadOnly && onDuplicate && ( |
| <CollapseToggleButton | ||
| collapsed={minimized} | ||
| onToggle={onToggleMinimize} | ||
| contentRef={containerRef} | ||
| className="!transition-opacity !duration-0 !delay-200 group-hover/tool:!delay-0 opacity-50 group-hover/tool:opacity-100" | ||
| /> |
| <CollapseToggleButton | ||
| collapsed={isMinimized} | ||
| onToggle={() => onToggleMinimize(index)} | ||
| contentRef={containerRef} | ||
| collapsedMaxHeight={48} | ||
| className="!transition-opacity !duration-0 !delay-200 group-hover/item:!delay-0 opacity-50 group-hover/item:opacity-100" | ||
| /> |
Context
In the playground, tool spec cards rendered fully expanded. A prompt with several tools pushed the real config far down the panel, and the cards had spacing bugs: expanded cards collided with the next card, while collapsed cards left an oversized gap. The collapse toggle only appeared on hover, so it was easy to miss.
Changes
Tool spec cards now collapse to a header-only row by default, with a height that follows the content rather than a fixed minimum. The collapse toggle is always visible (50% opacity at rest, 100% on hover) and its hover-out timing matches the other card icons.
The spacing bug came from the editor wrapper's
min-h-[70px]. The fix ismin-h-0plus symmetric padding, so expanded and collapsed cards keep the same uniformgap-2and don't collide.Message cards get the same always-visible toggle and a clean
1lh(one line height) collapse, but they default expanded (opposite of tools). Tool and message cards share the same left-padding alignment inside the container.Tests / notes
What to QA